package com.catsic.zcjc.enums;

/**
 * 数据状态
 * 
 * @author xietiebing
 *
 */
public enum ZcjcStatus {

	NORMAL("正常", 0), ERROR("错误", 1);

	private String name;
	private int index;

	private ZcjcStatus(String name, int index) {
		this.name = name;
		this.index = index;
	}

	public static String getName(Integer index) {
		if(index==null){
			return null;
		}
		if(index>0){
			index = 1;
		}
		
		for (ZcjcStatus c : ZcjcStatus.values()) {
			if (c.getIndex() == index) {
				return c.name;
			}
		}
		return null;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}
}
